package top.vanchor.flexible.config.initexception;

import lombok.Getter;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : Ding
 * @create 2022/4/3 20:48
 */
@Getter
public class ExceptionResponse {

    private final String msg;
    private final Integer code;
    private final String desc;

    public ExceptionResponse(Integer code, String msg) {
        this.msg = msg;
        this.code = code;
        this.desc = null;
    }

    public ExceptionResponse(Integer code, String msg, String desc) {
        this.msg = msg;
        this.code = code;
        this.desc = desc;
    }

    public static ExceptionResponse create(Integer code, String msg) {
        return new ExceptionResponse(code, msg);
    }

    public static ExceptionResponse exception(Integer code, String msg, String desc) {
        return new ExceptionResponse(code, msg,desc);
    }

}
